package MyOffer.JavaGuide;

/**
 * try-catch-finally finally会在try的return之前执行。
 */
public class FinallyTest {

    public static void main(String[] args) {
        System.out.println(f(2));//0
    }

    public static int f(int value) {
        try {
            return value * value;
        } finally {
            if (value == 2) {
                return 0;
            }
        }
    }
}
